﻿<%@ Page Title="Search Volunteers" Language="C#" MasterPageFile="~/Resources/AAMMaster.master"
    AutoEventWireup="true" CodeBehind="searchvolunteers.aspx.cs" Inherits="LMKJ.searchvolunteers" %>

<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <div class="form_name">
        Volunteer Management
    </div>
    <table>
        <tr>
            <td>
                Search:
            </td>
            <td>
                <asp:TextBox ID="searchTbx" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:DropDownList ID="searchDdl" runat="server">
                    <asp:ListItem Selected="True">Volunteer ID</asp:ListItem>
                    <asp:ListItem>Name</asp:ListItem>
                </asp:DropDownList>
                <asp:Button ID="searchBtn" Text="Search" runat="server" OnClick="searchBtn_Click"
                    CssClass="buttonSearch" ValidationGroup="SearchVolunteer" />
                <asp:Button ID="showAllBtn" Text="Show All" runat="server" OnClick="showAllBtn_Click"
                    CssClass="buttonShowAll" CausesValidation="False" />
            </td>
            <tr>
                <td colspan="3">
                    <asp:CustomValidator ID="searchValidator" runat="server" OnServerValidate="searchValidator_ServerValidate"
                        Display="Dynamic" ErrorMessage="Searching of Volunteer ID must only contain number!" ForeColor="Red"
                        ValidationGroup="SearchVolunteer"></asp:CustomValidator>
                </td>
            </tr>
        </tr>
    </table>
    <asp:DataList ID="volunteerDlist" runat="server" Width="100%">
        <HeaderTemplate>
            <table style="width: 100%">
                <tr>
                    <td>
                        <b>Volunteer ID</b>
                    </td>
                    <td>
                        <b>Name</b>
                    </td>
                    <td>
                        <b>Telephone</b>
                    </td>
                    <td>
                        <b>Email</b>
                    </td>
                    <td>
                        <b>Manage</b>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <asp:Label ID="volunteer_idLbl" runat="server" Text='<%# Eval("Volunteer_ID") %>'></asp:Label>
                </td>
                <td>
                    <asp:Label ID="nameLbl" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                </td>
                <td>
                    <asp:Label ID="telephoneLbl" runat="server" Text='<%# Eval("Telephone") %>'></asp:Label>
                </td>
                <td>
                    <asp:Label ID="emailLbl" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                </td>
                <td>
                    <asp:HyperLink ID="detailsHl" runat="server" Text="View Details" NavigateUrl='<%# "viewvolunteerdetails.aspx?details="+Eval("Volunteer_ID") %>'></asp:HyperLink>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table></FooterTemplate>
    </asp:DataList>
</asp:Content>
